package com.wb.factory;

import com.wb.utils.Constant;
import com.wb.utils.FileName;
import org.apache.commons.configuration.Configuration;

/**
 * 获取名称工厂类
 *
 * @author wb
 * @email 996649855@qq.com
 * @date 2021-10-21 20:38:01
 */
public abstract class FileNameFactory {
        abstract FileName createFileName(String template,String basePath,Configuration personalConfiguration,String className,String type);
       public  FileName getFileName(String template, String basePath, Configuration personalConfiguration, String className, String type){
            return  createFileName(template,basePath,personalConfiguration,className,type);
        }
        public static FileNameFactory getFileNameFactory(String name){
            assert name != null;
            if (name.equals(Constant.FACTORY_OBJECT_RD)) {
                return new RdFileName();
            }else if (name.equals(Constant.FACTORY_OBJECT_FAST)) {
                return new FastFileName();
            }
            return null;
        }
}
